package org.ithang.concurrent;

import org.junit.After;
import org.junit.Test;

public class SelfSyncTest {

	

	@Test
	public void demoTest(){
		Thread demo1=new Thread(SelfSync::demoA,"demo1");
		Thread demo2=new Thread(SelfSync::demoA,"demo2");
		demo1.start();
		demo2.start();
	}
	
	//@Test
	public void demoATest(){
		Thread demo1=new Thread(SelfSync::demoA,"demoA1");
		Thread demo2=new Thread(SelfSync::demoA,"demoA2");
		demo1.start();
		demo2.start();
	}
	
	//@Test
	public void demoBTest(){
		Thread demo1=new Thread(SelfSync::demoB,"demoB1");
		Thread demo2=new Thread(SelfSync::demoB,"demoB2");
		demo1.start();
		demo2.start();
	}
	
	//@Test
	public void demoCTest(){
		Thread demo1=new Thread(SelfSync::demoC,"demoC1");
		Thread demo2=new Thread(SelfSync::demoC,"demoC2");
		demo1.start();
		demo2.start();
	}
	
	//@Test
	public void demoDTest(){
		Thread demo1=new Thread(SelfSync::demoD,"demoD1");
		Thread demo2=new Thread(SelfSync::demoD,"demoD2");
		demo1.start();
		demo2.start();
	}
	
	
	
	
	@After
	public void after(){
		try{
	        Thread.sleep(6000);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
}
